package com.example.charlotte.snakegame;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.RadioButton;
import android.widget.Switch;

public class ChoiceActivity extends BaseActivity  implements View.OnClickListener{
    private ImageButton imageButton1,imageButton2,imageButton3;
    private GameMusic music;
    public static final int ESEY = 150;
    public static final int NORMAL = 100;
    public static final int HARD = 50;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_choice);
        imageButton1 = findViewById(R.id.easy);
        imageButton2 = findViewById(R.id.normal);
        imageButton3 = findViewById(R.id.hard);
        imageButton1.setOnClickListener(this);
        imageButton2.setOnClickListener(this);
        imageButton3.setOnClickListener(this);
        music=new GameMusic(this);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.easy:
                SnakeView.moveDelay=ESEY;
                break;
            case R.id.normal:
                SnakeView.moveDelay=NORMAL;
                break;
            case R.id.hard:
                SnakeView.moveDelay=HARD;
                break;
        }
        music.startMusic(3);
        Intent intent = new Intent(ChoiceActivity.this, GameActivity.class);
        startActivity(intent);
        this.finish();
    }
}
